import multiprocessing
import time
import os
def dance():
   # 获取当前进程的编号
  print('dance',os.getpid())
  # 获取当前进程
  print("dance",multiprocessing.current_process())
  for i in range(5):
    print("跳舞中...")
    time.sleep(0.2)
def sing():
   # 获取当前进程的编号
  print('sing',os.getpid())
  # 获取当前进程
  print("sing",multiprocessing.current_process())
  for i in range(5):
    print("跳舞中...")
    time.sleep(0.2)
if __name__ == "__main__":
  # 获取当前进程的编号
  print('main',os.getpid())
  # 获取当前进程
  print("main",multiprocessing.current_process())
  danceProcess=multiprocessing.Process(target=dance)
  singProcess=multiprocessing.Process(target=sing)

  danceProcess.start()
  singProcess.start()


